<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>购物商城-购物车</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/sp_cart.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/sp_car.js"></script>
</head>
<body onload="a()">
	<div class="sp_cart_div">
		<jsp:include page="head.jsp"></jsp:include>
	</div>
<form action="${pageContext.request.contextPath}/OrderSubmitServlet" method="get">
	<div class="sp_cart_div1">
		<table id="car_tb">
			<tr class="sp_tr1">
				<td class="sp_td1"><!--  input type="checkbox" id="selectAll">全选--></td>
				<td class="sp_td2" colspan="2">商品名称</td>
				<td class="sp_td3">积分</td>
				<td class="sp_td4">疯狂价</td>
				<td class="sp_td5">小计</td>
				<td class="sp_td6">数量</td>
				<td class="sp_td7">操作</td>
			</tr>
			
	
			<c:forEach var="li" items="${carList}" varStatus="status">
			<tr class="sp_tr2">
				<td class="sp_td_n1"><input type="checkbox" id="checkboxSon" class="checkboxSon" name ="checkbox" value=${li.articleId } ></td>
				<td class="sp_td_n2">
					<img alt="找不到图片" src="${pageContext.request.contextPath }/images/article/${li.image}">
				</td>
				<td class="sp_td_n3"><a href="">${li.title}</a></td>
				<td class="sp_td_n4"><span>0</span></td>
				<td class="sp_td_n5"><span>￥${li.price}(${li.discount*10}折)</span></td>
				<td class="sp_td_n6">￥
					<span id="price">
						<fmt:formatNumber type="number" value="${li.price * li.discount * li.buyNum}" pattern="0.00" maxFractionDigits="2">
						</fmt:formatNumber>
					</span>
				</td>
				<td class="sp_td_n7"><span id="buyNum">${li.buyNum}</span></td>
				<td class="sp_td_n3"><a href="/ShoppingWebsite/ArticleCarDeleteServlet?articleId=${li.articleId}">删除商品</a></td>

				<!-- 处理一行显示几个图片 -->

			<c:if test="${status.count%1==0 }">
			<tr>
			</c:if>
			</tr>
			</c:forEach>
		</table>
	</div>
	
	<div class="sp_cart_div2">
		<table>
			<tr>
				<td class="count">数量总计：<span></span>(件)
				</td>
			</tr>
			<tr>
				<td  class="amonut">金额总数：￥<input type="hidden" id="amount" name="amount" value="" /><span></span>（折后价）
				</td>
			</tr>
			<tr>
				<td>
					<a href="IndexServlet">
				 		<img alt="找不到图片" src="${pageContext.request.contextPath}/images/shop.jpg">
				 	</a>
				 	<input type="image" src="${pageContext.request.contextPath}/images/balance.jpg" name="submit">
				 </td>
			</tr>
		</table>
	</div>
</form>

</body>
</html>